package com.edu.mapper;

import com.edu.bean.Book;
import com.edu.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface BookMapper {

    @Select("select * from book where bookId = #{bookId}")
    Book selectBookById(int bookId);


    @Select("select * from book")
    List<Book> selectAllBook();


    @Insert("insert into book(bookName,bookWriter,bookType) values (#{bookName},#{bookWriter},#{bookType})")
    int insertBook(Book book);

    @Delete("delete from book where bookId = #{bookId}")
    int deleteBook(int bookId);

    @Update("update book set bookName = #{bookName},bookWriter=#{bookWriter},bookType=#{bookType} where bookId = #{bookId}")
    int updateBook(Book book);
}
